<?php include(TPL_PATH . '/admin/inc_header.php'); ?>
<?php include(TPL_PATH . '/admin/inc_top.php'); ?>

<script type="text/javascript">
<!--
$(document).ready(function() {
	$('.cls_order').tooltip({'placement':'right'}).each(function() {
		$(this).blur(function() {
			var _this = $(this);
			var v = _this.val();
			var id = _this.attr('id');
			if ('' != v) {
    			$.post('<?php p(HTTP_URL) ?>/index.php?m=admin&c=content&a=sort', {"id":id, "val":v}, function(re) {
    				if ('no' == re.ok) {
    					alert(re.msg);
    				} else if ('yes' == re.ok) {
						$('#' + id).attr('placeholder', v);
    				}
    				$('#' + id).val('');
    			}, 'json');
			}
		});
	});
	$('.cls_top').each(function() {
		$(this).click(function() {
			$.post('<?php p(HTTP_URL) ?>/index.php?m=admin&c=content&a=top', {"id":$(this).attr('id'), "val":(this.checked ? 1 : 0)}, function(re) {
				if ('no' == re.ok) {
					alert(re.msg);
				}
			}, 'json');
		});
	});
});
//-->
</script>

<table class="table table-bordered" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td colspan="8">
			<ul class="breadcrumb" style="margin:0px;">
				<li>内容列表 <span class="divider">/</span> </li>
				<li>
					<form method="get" action="" class="form-search" style="margin-bottom:0px;">
        				<input type="hidden" name="m" value="admin" />
        				<input type="hidden" name="c" value="content" />
        				<?php p($objTreeList->getSelect('cat_id', $catId, false, 'class="input-xlarge" onchange="this.form.submit();"', array(array(-1, '--- 所有栏目 ---'), array(0, '未指定栏目')))) ?>
        				<div class="input-append">
                            <input type="text" name="keyword" value="<?php p($strKeyword) ?>" class="search-query" />
                            <button type="submit" class="btn">搜索</button>
                        </div>
        			</form>
				</li>
			</ul>
		</td>
	</tr>
	<tr>
		<th style="width:100px;">栏目</th>
		<th style="width:35px;">ID</th>
		<th>标题</th>
		<th style="width:80px;">作者</th>
		<th style="width:75px;">排序</th>
		<th style="width:50px;">置顶</th>
		<th style="width:31px;">状态</th>
		<th style="width:55px;">编辑</th>
	</tr>
	<?php foreach ($arrList as $arrTemp) { ?>
	<tr>
		<td><?php p($mdlCat->getBackPathLinks($arrTemp['cat_id'], true)) ?></td>
		<td><?php p($arrTemp['id']) ?></td>
		<td><small><?php p($arrTemp['title']) ?></small></td>
		<td title="created@<?php p($arrTemp['created_at']) ?>"><?php p($arrTemp['user_name']) ?></td>
		<td><input style="margin-bottom:0px;" type="text" id="id_<?php p($arrTemp['id']) ?>" placeholder="<?php p($arrTemp['list_order']) ?>" value="" class="cls_order input-mini" title="正整数,较大的排序在前,即时保存"></td>
		<td><label class="checkbox"><input type="checkbox" class="cls_top" value="1" <?php $arrTemp['is_top'] && p('checked="checked"') ?> id="id_top_<?php p($arrTemp['id']) ?>" /> 置顶</label></td>
		<td><i class="icon-<?php ($arrTemp['rec_status']) ? p('ok') : p('remove'); ?>"></i></td>
		<td><a class="btn" href="<?php p(HTTP_URL) ?>/index.php?m=admin&c=content&a=edit&id=<?php p($arrTemp['id']) ?>">编辑</a></td>
	</tr>
	<?php } ?>
	<?php $strTemp = $objPager->genHtml(); if (!empty($strTemp)) { ?>
	<tr>
		<td colspan="8">
			<?php p($strTemp) ?>
		</td>
	</tr>
	<?php } ?>
	<tr>
		<td colspan="8" style="text-align:center;">
			<?php p($objPager->strInfo) ?>
		</td>
	</tr>
</table>

<?php include(TPL_PATH . '/admin/inc_bottom.php'); ?>
<?php include(TPL_PATH . '/admin/inc_footer.php'); ?>